package main.java;

import java.math.BigDecimal;

class Row {
    String isbn;
    String name;
    BigDecimal money;

    boolean isBlank;
    boolean isPageTotal;
    boolean isChapterTotal;
    boolean isGrandTotal;

    Row(String isbn, String name, BigDecimal money) {
        this.isbn = isbn;
        this.name = name;
        this.money = money;
    }

    static Row blank(String isbn) {
        Row r = new Row(isbn, "", BigDecimal.ZERO);
        r.isBlank = true;
        return r;
    }

    static Row pageTotal(String isbn, BigDecimal total) {
        Row r = new Row(isbn, "本页小计", total);
        r.isPageTotal = true;
        return r;
    }

    static Row chapterTotal(String isbn, BigDecimal total) {
        Row r = new Row(isbn, "本章小计", total);
        r.isChapterTotal = true;
        return r;
    }

    static Row grandTotal(BigDecimal total) {
        Row r = new Row("", "总合计", total);
        r.isGrandTotal = true;
        return r;
    }
}